﻿<UserControl x:Class="CloudStorageLight.WpfClient.CreateDirectoryWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:properties="clr-namespace:CloudStorageLight.WpfClient.Properties"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:CloudStorageLight.WpfClient"
             mc:Ignorable="d" 
             Height="100" Width="300">
    <UserControl.Resources>
        <local:BindingProxy x:Key="proxy" Data="{Binding}" />
        <Style TargetType="{x:Type Control}" x:Key="baseStyle">
            <Setter Property="FontSize" Value="{Binding Path=Data.FontSize, Source={StaticResource proxy}}" />
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="{Binding Path=Data.FontSize, Source={StaticResource proxy}}" />
        </Style>
        <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource baseStyle}"></Style>
    </UserControl.Resources>
    <Grid FocusManager.FocusedElement="{Binding ElementName=FolderName}">
        <ContentControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" IsTabStop="False">
            <ContentControl.Resources>
                <ResourceDictionary>
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="/ViewMaker.Core;component/wpf/wpfgenericresource.xaml" />
                        <ResourceDictionary Source="/ViewMaker.Core;component/wpf/wpferrorstyleresource.xaml" />
                    </ResourceDictionary.MergedDictionaries>
                </ResourceDictionary>
            </ContentControl.Resources>
            <Grid Name="CreateDirectoryVM" DataContext="{Binding Mode=OneWay}">
                <Grid Name="CreateDirectoryVMDataPanel" Margin="10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="0">
                    <Label HorizontalContentAlignment="Left" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0">
                        <TextBlock Text="{x:Static properties:Resources.MsgFolderName}" />
                    </Label>
                    <TextBox Name="FolderName" FontSize="{Binding Path=FontSize}" Text="{Binding Path=FolderName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True }" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" />
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                </Grid>
                <StackPanel Name="CreateDirectoryVMButtonPanel" Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0">
                    <Button Name="OKCommand" Command="{Binding Path=OKCommand,Mode=OneWay}" IsEnabled="{Binding Path=CanOK, Mode=OneWay }" Margin="5" >
                        <TextBlock Text="{x:Static properties:Resources.MsgOK}" />
                    </Button>
                    <Button Name="CloseCommand" Command="{Binding Path=CloseCommand,Mode=OneWay}" Margin="5">
                        <TextBlock Text="{x:Static properties:Resources.MsgCancel}" />
                    </Button>
                </StackPanel>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
            </Grid>
        </ContentControl>
    </Grid>
</UserControl>
